﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dominion.Core;

namespace Dominion.Core
{
    public class MoneyLenderBehavior : Behavior
    {
         public override void Run(Player player)
        {
            var coppers = player.Cards.Hand.OfType<Treasure>().Where(c => c.Kind == Kind.Copper);
            if (coppers.Any())
            {
                Treasure c = coppers.ToList().Pop();
                player.Trash(c);
                player.BuyBonus += 3;
            }
        }

        
    }
}
